   Help for ZipInf

Properties	Methods

Registration Information

Order Form

Getting Custom Controls Written

Description

ZipInf is a Visual Basic custom control that lets you find out what files are in the ZIP file and lots of information about those files.  ZipInf does not compress or decompress data.

File Name

ZIPINF1.VBX

Object Type

MabryZipInfo

Distribution Note     When you develop and distribute an application that uses ZipInf, you should install the file ZIPINF1.VBX into the users Windows SYSTEM directory.  ZipInf has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version of ZipInf.


Properties

All of the properties that apply to this control are in this table.  Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

Align	*ItemCRC	*ItemUncompressed

*DateFormat	*ItemDate	Left

Enabled	*ItemFileComment	*ListCount

*FileComment	*ItemFileName	Name

*FileName	*ItemMethod	Tag

*ItemCompressed	*ItemTime	Top

Enabled is the default value for the control.


DateFormat Property

See Also	Example

Description

Determines the format of the date used by the ItemDate property.

Usage

[form.][control.]DateFormat[ = date string ]

Remarks

Setting this property determines the format used by the ItemDate propItemDate property.  This can be used to override the international settings found in WIN.INI.  Using this property can ensure that you always get a date formatted in a specific fashion.  If you leave it to the format found in WIN.INI, youll have to figure out what format (i.e., MM/DD/YY, DD/MM/YY, YY/MM/DD, etc.) it is.

This string can consist of punctuation and symbols.  The symbols are:

Symbol	Description

d	Day of the month: 1 - 31

dd	Day of the month: 00 - 31

m	Month of the year: 1 - 12

mm	Month of the year: 01 - 12

yy	Year: 00 - 99

yyyy	Year: 1970 - 2099

More information about this format can be found in the Windows Resource Kit under [intl] Section, and in the VB Programmers Guide under Format$.

Data Type

String


See Also

Properties:

ItemDate


DateFormat Property Example

In this example, the program shows the DateFormat property affects the ItemDate property. To try this example, paste the code into the Declarations section of a form that contains two text boxes, a command button, and a ZipInf control.  Press F5.  Fill in the first text box with a legitimate ZIP file name (with full path).  Fill in the second text box with a date format string (such as MM-DD-YY or D-M-YYYY).  Then, press the command button.

Sub Command1_Click ()

    Dim I As Integer

    List1.Clear

    ZipInfo1.FileName = Text1.Text

    ZipInfo1.DateFormat = Text2.Text

    For I = 0 To ZipInfo1.ListCount - 1

        List1.AddItem ZipInfo1.ItemFileName(I) & " " & ZipInfo1.ItemDate(I)

    Next I

End Sub


FileComment Property

See Also	Example

Description

Holds the comment field from the ZIP file.

Usage

[form.][control.]FileComment

Remarks

This property holds the comment string loaded from the ZIP file (specified by the FileName property).

This property is read-only.

Data Type

String


See Also

Properties:

FileName

ItemFileComment

ListCount


FileName Property

See Also	Example

Description

Specifies the ZIP file to examine.

Usage

[form.][control.]FileComment[ = string ]

Remarks

Setting this property causes ZipInf to load the various properties with information from the ZIP file specified.  If the file specified is not found, ZipInf will cause a File Not Found (7) error.  If this file specified is not a ZIP file, ZipInf will cause a Not a ZIP File (29999) error.  If the ZIP file is corrupt, ZipInf will cause a Corrupt ZIP File (29998) error.

Data Type

String


See Also

Properties:

FileComment

ItemFileName


File Properties Example

In this example, the program shows the ListCount and FileComment properties. To try this example, paste the code into the Declarations section of a form that contains two labels, a text box, a command button, and a ZipInf control.  Press F5.  Fill in the text box with the filename (including full path) of a ZIP file.  Then, press the command button.

Sub Command1_Click ()

    ZipInfo1.FileName = Text1.Text

    If Len(ZipInfo1.FileComment) = 0 Then

        Label1.Caption = "FileComment: (none)"

    Else

        Label1.Caption = "FileComment: " & ZipInfo1.FileComment

    End If

    Label2.Caption = "ListCount: " & ZipInfo1.ListCount

End Sub


ItemCompressed Property

See Also	Example

Description

Tells the compressed size of a file in the ZIP file.

Usage

[form.][control.]ItemCompressed(FileIndex)

Remarks

This property tells the compressed size (i.e., how much space it takes up in the ZIP file) of the file specified by FileIndex.  FileIndex must be between 0 and ListCount.

This property is read-only and only available at run-time.

Data Type

Integer (long)


See Also

Properties:

ItemCRC

ItemMethod

ItemUncompressed


ItemCRC Property

See Also	Example

Description

Tells the 32-bit CRC of a file in the ZIP file.

Usage

[form.][control.]ItemCRC(FileIndex)

Remarks

This property tells the 32-bit cyclic redundancy check (CRC) of the file specified by FileIndex.  FileIndex must be between 0 and ListCount.

This property is read-only and only available at run-time.

Data Type

Integer (long)


See Also

Properties:

ItemCompressed

ItemMethod

ItemUncompressed


ItemDate Property

See Also	Example

Description

Tells the date stamp of a file in the ZIP file.

Usage

[form.][control.]ItemDate(FileIndex)

Remarks

This property tells the date stamp on the file specified by FileIndex.  FileIndex must be between 0 and ListCount.  The format of this property is determines by the short date format in WIN.INI and by the DateFormat property (which takes precedence).

This property is read-only and only available at run-time.

Data Type

String


See Also

Properties:

DateFormat

ItemTime


ItemFileComment Property

See Also	Example

Description

Tells the comment associated with a file in the ZIP file.

Usage

[form.][control.]ItemFileComment(FileIndex)

Remarks

This property tells the comment associated with the file specified by FileIndex.  FileIndex must be between 0 and ListCount.

This property is read-only and only available at run-time.

Data Type

String


See Also

Properties:

FileComment

ItemFileName


ItemFileName Property

See Also	Example

Description

Tells the name of a file in the ZIP file.

Usage

[form.][control.]ItemFileName(FileIndex)

Remarks

This property tells the name of the file specified by FileIndex.  FileIndex must be between 0 and ListCount.

This property is read-only and only available at run-time.

Data Type

String


See Also

Properties:

FileName

ItemFileComment


ItemMethod Property

See Also	Example

Description

Tells the compressed method used for a file in the ZIP file.

Usage

[form.][control.]ItemMethod(FileIndex)

Remarks

This property tells the compressed method used on the file specified by FileIndex.  FileIndex must be between 0 and ListCount.  The compression methods are:

Value	Description

0	No compression.  Stored.

1	Shrunk.

2	Reduced.

3	Reduced.

4	Reduced.

5	Reduced.

6	Imploded.

7	Tokenized (not used).

8	Deflated.

This property is read-only and only available at run-time.

Data Type

Integer


See Also

Properties:

ItemCompressed

ItemCRC

ItemUncompressed


ItemTime Property

See Also	Example

Description

Tells the time stamp on a file in the ZIP file.

Usage

[form.][control.]ItemTime(FileIndex)

Remarks

This property tells the time stamp on the file specified by FileIndex.  FileIndex must be between 0 and ListCount.  This propertys foramt is HH:MM:SS (i.e., like the default Time$ format).

This property is read-only and only available at run-time.

Data Type

String


See Also

Properties:

ItemDate


ItemUncompressed Property

See Also	Example

Description

Tells the full size of a file in the ZIP file.

Usage

[form.][control.]ItemUncompressed(FileIndex)

Remarks

This property tells the full size (i.e., uncompressed, in bytes) of the file specified by FileIndex.  FileIndex must be between 0 and ListCount.

This property is read-only and only available at run-time.

Data Type

Integer (long)


See Also

Properties:

ItemCompressed

ItemCRC

ItemMethod


ListCount Property

See Also	Example

Description

Specifies how many files are within the ZIP file.

Usage

[form.][control.]ListCount

Remarks

This property gets set when the FileName property is set.  This property tells how many files are in the ZIP file.  The information about the individual files can be accessed through the following properties: ItemCRC , ItemCompressedpropItemCompressed, ItemDate, ItemFileName, ItemFileComment, ItemMethod, ItemTime, and ItemUncompressed.

If the file currently selected is not a ZIP file or if the file specified doesnt exist, this property will be set to -1.

This property is read-only.

Data Type

Integer


See Also

Properties:

FileName


Item Properties Example

In this example, the program shows the various ZIP file item properties. To try this example, paste the code into the Declarations section of a form that contains seven labels (make these somewhat wide), a text box, a command button, a list box, and a ZipInf control.  Press F5.  Fill in the text box with the filename (including full path) of a ZIP file.  Then, click on various file names in the list box.

Sub Command1_Click ()

    Dim I As Integer

    ZipInfo1.FileName = Text1.Text

    List1.Clear

    For I = 0 To ZipInfo1.ListCount - 1

        List1.AddItem ZipInfo1.ItemFileName(I)

    Next I

End Sub

Sub List1_Click ()

    Dim I As Integer

    I = List1.ListIndex

    Label1.Caption = "ItemCompressed: " & ZipInfo1.ItemCompressed(I)

    Label2.Caption = "ItemCRC: " & Hex$(ZipInfo1.ItemCRC(I))

    Label3.Caption = "ItemDate: " & ZipInfo1.ItemDate(I)

    Label4.Caption = "ItemFileComment: " & ZipInfo1.ItemFileComment(I)

    Label5.Caption = "ItemMethod: " & ZipInfo1.ItemMethod(I)

    Label6.Caption = "ItemTime: " & ZipInfo1.ItemTime(I)

    Label7.Caption = "ItemUncompressed: " & ZipInfo1.ItemUncompressed(I)

End Sub


Methods

All of the methods that apply to this control are in this table.  Methods that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

Clear (clears all file info)


Registration Information

Credits

ZipInf was written by James Shields.  Inquiries can be sent to 71231,2066 on CompuServe, or mabry@halcyon.com on Internet.  If you must send something via U.S. Mail, the address is:

Mabry Software

Post Office Box 31926

Seattle, WA  98103-1926

Mabry Software Products are handled in the UK by

Springfield Publishing Ltd

Springfield House

Llanfynydd

WREXHAM

Clwyd  LL11 5HW

Registration

You can register this program for  £9.95 + P&P (£1.95 UK, £3.00 EEC £4.00 Rest of the World).

For your convenience, an order form has been provided that you can print out directly from help.

Source Code and Registration

Source code (which includes a registered copy) to this control is available for £41.95 + P&P (£1.95 UK, £3.00 EEC £4.00 Rest of the World)..  With source code you get a registered version of the control.

Credit Card Orders

You can order this program with Mastercard, Access or Visa from Springfield Publishing Ltd. either by writing to the above address or by:

Telephone 	(01352) 770049

Fax	(01352) 770816

INTERNET	mabry@sprsoft.demon.co.uk

CompuServe	100273,2006

© Copyright 1993-1994 by James Shields


Order Form
 ZipInf Order Form

Use the Print Topic.. command from the File menu to print this order form.

Mail this	Springfield Publishing Ltd	Telephone: (01352) 770049

form to:	Springfield House	Fax (01352) 770816

Llanfynydd 	Internet: mabry@sprsoft.demon.co.uk

WREXHAM	Compuseve 100273,2006

Clwyd   LL11 5HW

Where did you get this copy of ZipInf ? __________________________________________

Ship to:	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone:	_________________________________________________________________

Fax:	_________________________________________________________________

E-Mail:	_________________________________________________________________

Disk Size:	_____________________________

Quantity

________	£  9.95 Registration

________	£41.95 Registration + Source Code

________	Postage & Packing (£1.95 UK  £3.00 Europe £4.00 Rest of World)

________	TOTAL

____	Please Debit my Visa/Mastercard  No __________________________   Exp ___

____	I Enclose a Cheque/PO made payable to Springfield Publishing Ltd


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact me at the following:

James Shields

Mabry Software

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272

BBS: WinDev BBS 206-634-0783

CompuServe: 71231,2066

Internet: mabry@halcyon.com